package com.musicdaze.utils;

/**
 * This class represents a Triple that corresponds to a group of three objects
 * of distinct classes. 
 *
 * @author Mikey Fujihara
 */
public class Triple<S,T,U> {
  /** params */
  public S left;
  public T middle;
  public U right;
  /**
   * default constructor
   */
  public Triple(){
    
  }
  /**
   * Public constructor that sets left, middle, and right of this
   * triple.
   * @param left the left
   * @param middle the middle
   * @param right the right
   */
  public Triple(S left, T middle, U right){
    this.left = left;
    this.middle = middle;
    this.right = right;
  }
  /** {@inheritDoc} */
  public boolean equals(Object o){
    if (o instanceof Triple){
      Triple t = (Triple) o;
      return t.left.equals(left) && t.right.equals(right) && t.middle.equals(middle);
    }
    return false;
  }
  /** {@inheritDoc} */
  @Override
  public int hashCode() {
    return left.hashCode() + middle.hashCode() + right.hashCode();
  }
}
